import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, MaxLength, Matches } from 'class-validator';

export class UpdateUserInfoDto {
  @ApiProperty({
    description: 'User display name',
    example: 'John Doe',
    required: false,
  })
  @IsString()
  @IsOptional()
  @MaxLength(64, { message: 'Display name cannot exceed 64 characters' })
  displayName?: string;

  @ApiProperty({
    description: 'User phone number',
    example: '13800138000',
    required: false,
  })
  @IsString()
  @IsOptional()
  @Matches(/^\d{11}$/, { message: 'Phone number must be 11 digits' })
  phone?: string;
}
